
/**
 * 
 */
package com.swg.cocobox.filetransfer.command;

import com.swg.cocobox.filetransfer.internal.ReplyCommandBuilder;
import com.swg.cocobox.filetransfer.internal.ReplyCommandParser;

/**
 * @author satriaprayoga
 *
 */
public abstract class ReplyCommandFactory implements CommandFactory{
	
	private final ReplyCommandBuilder builder;
	private final ReplyCommandParser parser;
	
	public ReplyCommandFactory(ReplyCommandBuilder builder,ReplyCommandParser parser) {
		this.builder=builder;
		this.parser=parser;
	}
	
	public ReplyCommand createReply(int code,String message){
		return builder.buildReply(code, message);
	}
	
	public ReplyCommand parseCommand(byte[] data){
		return parser.parseReply(data);
	}
	
}
